<script lang="ts" setup>
import { useTableHook } from "@/hooks/useTableMixin"
import { ref, defineEmits } from "vue";
import { onMounted } from "vue";
import Table from "./index";

const { loading } = useTableHook()
const emit = defineEmits(["change"])
const props = defineProps(["data", "tableJson", "total"])
const tabler = ref()
const tableHeight = ref(0)

const getTableHeight = () => {
  tableHeight.value = tabler.value?.parentNode.clientHeight - 90

}
onMounted(() => {
  getTableHeight()
})


</script>

<template>
  <div ref="tabler" class="adasdada">

    <Table v-bind="props" :maxHeight="tableHeight + ''" :loading="loading" @change="(e) => emit('change', e)">
    </Table>
  </div>
</template>
